package org.finesys.common.log.config;

import org.finesys.common.log.trace.interceptor.mvc.SpringMvcInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@ConditionalOnClass(value = {DispatcherServlet.class})
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注入mvc拦截
        registry.addInterceptor(new SpringMvcInterceptor());
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}
